package com.blackitheima2.InnerDemo.test2;

public class TestSwim {
    public static void main(String[] args) {
        //匿名内部类
        goSwimming(new Swimming() {
            @Override
            public void swim() {
                System.out.println("黑子,快,游回来!");
            }
        });

    }
    public static void goSwimming(Swimming swimming){
        swimming.swim();
    }
}
//接口
interface Swimming{
    public abstract void swim();
}
